import { lazy } from "react";
import {createBrowserRouter} from "react-router-dom"

const Home=lazy(()=> import("../pages/Home/Home"));
const List=lazy(()=> import("../pages/List/List"));
const Detail=lazy(()=> import("../pages/Detail/Detail"));
const AddList=lazy(()=> import("../pages/AddList/AddList"));

export const routes=([
    {
        path:"/",
        element:<Home></Home>
    },
    {
        path:"/list",
        element:<List></List>
    },
    {
        path:"/detail",
        element:<Detail></Detail>
    },
    {
        path:"/addlist",
        element:<AddList></AddList>
    },
])

export const priviteRoutes=createBrowserRouter(
    routes.map((v)=>{
        return {...v}
    })
)